/**
 * @Author Puzzle
 * @Date 2022/6/20 9:58 上午
 **/

package core

import (
	"sync"

	"github.com/mojocn/base64Captcha"
)

var (
	storeOnce   sync.Once
	storeServer base64Captcha.Store
)

// 初始化内部缓存
func loadCache() base64Captcha.Store {
	return base64Captcha.DefaultMemStore
}

// Cache 缓存
func Cache() base64Captcha.Store {
	storeOnce.Do(func() {
		storeServer = loadCache()
	})
	return storeServer
}
